<template>
  <div>
    <li class="cartli"  >
        <div class="commodity-card">
          <div class="cardimg">
            <img class="cardimg1" :src="data.image" />
          </div>
          <div class="cardtext">
            <div class="cardtext1">{{data.title}}</div>
            <div class="cardtext2" v-if="data.title">
              <span class="cartspan1">天猫</span>
              <span class="cartspan2">包邮</span>
            </div>
            <div class="cardtext3" v-if="data.title">
              <div class="left">
                <span class="price">￥{{data.price}}</span>
                <span class="price-tag">{{data.originPrice}}万人已买</span>
              </div>
              <span class="right">{{data.couponValue}}</span>
            </div>
          </div>
        </div>
      </li>
  </div>
</template>
<script>

export default {
  props: ['datalist', 'data'],
  methods: {

  }
}
</script>
<style lang="scss" scoped>

.cartli {
  // background-color: pink;
  // height: 308px;
  display: block;
  float: left;
  width: 50%;
  height: 277px;
  overflow: hidden;
  margin-bottom: 5px;
  position: relative;
  box-sizing: border-box;
  .commodity-card {
    display: inline-block;
    width: 100%;
    height: 100%;
    float: left;
    position: relative;
    border: none;
    box-shadow: 0 1px 1px -1px rgba(0, 0, 0, 0.5);
    .cardimg {
      width: 100%;
      display: block;
      .cardimg1 {
        display: block;
        width: 100%;
      }
    }
  }
}
.cardtext {
  padding: 9px 9px;
  box-sizing: border-box;
  .cardtext1 {
    overflow: hidden;
    font-size: 12px;
    line-height: 18px;
    text-overflow: ellipsis;
    color: #877a73;
    white-space: nowrap;
  }
  .cardtext2 {
    overflow: hidden;
    position: relative;
    margin: 4px auto 0;
    .cartspan1 {
      float: left;
      margin: 0 4px 0 0;
      font-size: 12px;
      margin-left: 4px;
      color: #fff;
      background-color: #df2b2f;
    }
    .cartspan2 {
      position: absolute;
      // bottom: -1px;
      right: 0;
      margin: 0;
      padding: 0;
      font-size: 12px;
      color: #877a73;
      box-shadow: none;
    }
  }
  .cardtext3 {
    position: relative;
    height: 40px;
    // font-size: 0;
    overflow: hidden;
    margin-top: 4px;
    text-align: left;
    vertical-align: bottom;
    .price {
      color: #fa585a;
      vertical-align: bottom;
    }
    .price-tag {
      position: absolute;
      bottom: 10px;
      left: 45px;
      display: inline-block;
      font-size: 10px;
      color: #877a73;
      letter-spacing: 0;
    }
    .right {
      position: absolute;
      bottom: 12px;
      right: 2px;
      padding: 2px 0.3px 0;
      font-size: 12px;

      text-align: center;
      color: #fa585a;
      border-radius: 2px;
      box-shadow: inset 0 0 0 1px #fa585a;
      vertical-align: bottom;
    }
  }
}
.cartul {
  // display: flex;
}
</style>
